package population.populationFindPredicates;

import character.Character;

/**
 * Finds specific race.
 * @author pcdejager
 *
 */
public class FindRace implements PopulationFindPredicate {
    /**
     * Constructor.
     * @param r The name of the race to find
     */
    public FindRace(final String r) {
        race = r;
    }

    /**
     * Check if specific race.
     * @param c The character to test
     * @return True if correct race, else false
     */
    public final boolean check(final Character c) {
        if (race.equals(c.getRace().getName())) {
            return true;
        }
        return false;
    }

    /**
     * The race to find.
     */
    private String race;
}
